<%@page import="com.neiquan.backstage.pub.bsc.dao.po.Lease"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.MeetingOrder"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.SceneVisitReservation"%>
<%@page import="com.neiquan.backstage.meeting_order.MeetingOrderService"%>
<%@page import="com.neiquan.backstage.scene_visit_reservation.SceneVisitReservationService"%>
<%@page import="com.neiquan.backstage.resourec_manage.ResourecLeaseService"%>
<%@page import="com.neiquan.backstage.common.util.Sessions"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.User"%>
<%@page import="com.neiquan.backstage.common.util.Configs"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.Event"%>
<%@page import="java.util.List"%>
<%@page import="com.neiquan.backstage.event.EventService"%>
<%@page import="com.neiquan.backstage.common.CommonService"%>
<%@page import="com.neiquan.backstage.common.util.SpringContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	ApplicationContext appCtx = SpringContextUtils.getApplicationContext();
	CommonService commonService = appCtx.getBean(CommonService.class);
	User loginedUser = (User) Sessions.getLoginedUser(session);
	int userId=loginedUser.getUserId();
	int memberId=loginedUser.getMemberId();
	ResourecLeaseService resourecLeaseService = appCtx.getBean(ResourecLeaseService.class);
	SceneVisitReservationService sceneVisitReservationService= appCtx.getBean(SceneVisitReservationService.class);
	MeetingOrderService meetingOrderService=appCtx.getBean(MeetingOrderService.class);
	List<Lease> leases=resourecLeaseService.queryByUserId(userId, memberId);
	List<SceneVisitReservation> sceneVisitReservations=sceneVisitReservationService.queryByUserId(userId, memberId);
	List<MeetingOrder> meetingOrders=meetingOrderService.queryByUserId(userId, memberId);
	
%> 
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>查看申请</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/main.css" />
</head>
<body bgcolor="#f0f0f0">
		<section class="mt">
		<%for(Lease l:leases){ %>
			<section class="apply common_bg" >
				<section class="apply_left fl pd" >
					<p class="apply_detail">
						<span calss="fl" >
							工位申请
						</span>
						<%if(l.getStatus()==0){ %>
						<span class="fr" >
								审核中
						</span>
						<%} %>
						<%if(l.getStatus()==1){ %>
						<span class="fr" >
								完成审核
						</span>
						<%} %>
						<%if(l.getStatus()==2){ %>
						<span class="fr">
								完成审核
						</span>
						<%} %>
					</p>
					<time class="apply_time">
					<%
					 if(l.getDtCreat()!=null){
					%>
					<%=commonService.formatTimestamp(l.getDtCreat(),"yyyy-MM-dd hh:mm")%> 
					<%
					 }
					%>
					</time>
				</section>
				<section class="fr" >
					<input class="btn apply_btn" value="查看详情" onClick="lookStation()">
				</section>
			</section>
 			<section class="line"></section>
 			<%} %>
 			
			<%for(SceneVisitReservation s:sceneVisitReservations){ %>
			<section class="apply common_bg" >
				<section class="apply_left fl pd" >
					<p class="apply_detail">
						<span calss="fl" >
							场地参观申请
						</span>
						<%if(s.getStatus()==0){ %>
						<span class="fr" >
								审核中
						</span>
						<%} %>
						<%if(s.getStatus()==1){ %>
						<span class="fr" >
								已通过
						</span>
						<%} %>
						<%if(s.getStatus()==2){ %>
						<span class="fr">
								已驳回
						</span>
						<%} %>
					</p>
					<time class="apply_time">
					<%
					 if(s.getDtCreat()!=null){
					%>
					<%=commonService.formatTimestamp(s.getDtCreat(),"yyyy-MM-dd hh:mm") %>
					<%
					 }
					%>
					
					</time>
				</section>
				<section class="fr" >
					<input class="btn apply_btn" value="查看详情" onClick="lookAddre(<%=s.getSceneVisitReservationId()%>)">
				</section>
			</section>
 			<section class="line"></section>
 			<%} %>
 					<%for(MeetingOrder m:meetingOrders){ %>
			<section class="apply common_bg" >
				<section class="apply_left fl pd" >
					<p class="apply_detail">
						<span calss="fl" >
							会议室申请
						</span>
						<%if(m.getStatus()==0){ %>
						<span class="fr" >
								审核中
						</span>
						<%} %>
						<%if(m.getStatus()==1){ %>
						<span class="fr" >
								完成审核
						</span>
						<%} %>
						<%if(m.getStatus()==2){ %>
						<span class="fr">
								完成审核
						</span>
						<%} %>
					</p>
					<time class="apply_time">
					<%
					 if(m.getDtCreat()!=null){
					%>
					<%=commonService.formatTimestamp(m.getDtCreat(),"yyyy-MM-dd hh:mm") %> 
					<%
					 }
					%>
					</time>
				</section>
				<section class="fr" >
					<input class="btn apply_btn" value="查看详情" onClick="lookMeeting(<%=m.getMeetingOrderId()%>)">
				</section>
			</section>
 			<section class="line"></section>
 			<%} %>
		</section>
</body>
		<script src="js/jquery.min.js"></script>
		<script src="js/main.js"></script>
		<script src="js/responsive.js"></script>
		<script type="text/javascript">
			function lookMeeting(id){
				window.location.href="boardroomdetails.jsp?id="+id;
			}
			function lookAddre(id){
				window.location.href="addrvisitordetails.jsp?id="+id;
			}
			function lookStation(id){
				window.location.href="mystation.jsp";
			}
		</script>
</html>
